package com.company.project.util;

import org.springframework.stereotype.Component;

import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

@Component
public class periodicalsWhere {

    //影响因子
    private List<String> combinedIf;

    //期刊等级
    private List<String> level;

    //发刊周期
    private List<String> publicationCycle;

    //期刊专业
    private List<String> cId;

    //期刊核心
    private List<String> dbId;

    private String maxCombinedIf;

    private String minCombinedIf;

    public String getMaxCombinedIf() {
        return maxCombinedIf;
    }

    public void setMaxCombinedIf(String maxCombinedIf) {
        this.maxCombinedIf = maxCombinedIf;
    }

    public String getMinCombinedIf() {
        return minCombinedIf;
    }

    public void setMinCombinedIf(String minCombinedIf) {
        this.minCombinedIf = minCombinedIf;
    }

    private PageUtil pageUtil;

    public List<String> getCombinedIf() {
        return combinedIf;
    }

    public void setCombinedIf(List<String> combinedIf) {
        this.combinedIf = combinedIf;
        if (combinedIf.size() == 1) {
            String c = combinedIf.get(0);
            if (c.contains("+")) {
                this.minCombinedIf = c.substring(0, c.indexOf("+"));
            } else {
                String[] ing = c.split("~");
                if (ing.length == 1) {
                    this.minCombinedIf = ing[0];
                } else {
                    this.minCombinedIf = ing[0];
                    this.maxCombinedIf = ing[1];
                }
            }
        }
    }

    public List<String> getDbId() {
        return dbId;
    }

    public void setDbId(List<String> dbId) {
        this.dbId = dbId;
    }

    public List<String> getLevel() {
        return level;
    }

    public void setLevel(List<String> level) {
        this.level = level;
    }

    public List<String> getPublicationCycle() {
        return publicationCycle;
    }

    public void setPublicationCycle(List<String> publicationCycle) {
        this.publicationCycle = publicationCycle;
    }

    public List<String> getcId() {
        return cId;
    }

    public void setcId(List<String> cId) {
        this.cId = cId;
    }

    public PageUtil getPageUtil() {
        return pageUtil;
    }

    public void setPageUtil(PageUtil pageUtil) {
        this.pageUtil = pageUtil;
    }
}
